package com.rmd.dl.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rmd.dl.domain.po.DlRole;
import com.rmd.dl.domain.po.DlRoleExample;
import com.rmd.dl.mapper.DlRoleMapper;
import com.rmd.dl.service.UserService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private DlRoleMapper dlRoleMapper;

	public JSONObject list() {
		JSONObject jsonObject = new JSONObject();
		DlRoleExample example = new DlRoleExample();
		List<DlRole> list = dlRoleMapper.selectByExample(example);
		JSONArray array = new JSONArray();
		for(DlRole role:list){
			array.add(role);
		}
		jsonObject.put("value", array);
		return jsonObject;
	}
	
}
